<?php
namespace app\home\controller;
use think\Db;
use think\captcha\Captcha;
use think\Loader;
class Myqrcode extends \think\Controller{
    public function Myqrcode(){
        $id=session('id');
        $key=$id.'dfksa';
        $key=md5($key);
        $this->assign('id',$id);
        $this->assign('key',$key);
        return $this->fetch('myqrcode');//继承基类的控制器 
    }
    public function qrcode(){
        $id=session('id');
        $key=$id.'dfksa';
        $key=md5($key);
        $url="http://192.168.1.66/home/reg/reg?id=$id&key=$key";
        Vendor('phpqrcode.phpqrcode');
        $level='L';
        $size=4;
        $QRcode=new \QRcode();
        $QRcode->png($url,false,$level,$size,2);
    }
    
}